#include "gnurilla.h"

GtkWidget *gnurilla_create_main_window (GnurillaData *gd)
{
	GtkWidget *vbox;
	GtkWidget *window;
	GtkWidget *menubar;
	GtkWidget *toolbar;
	GtkWidget *notebook;
   	GtkWidget *statusbar;
	
	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	gtk_window_maximize(GTK_WINDOW(window));
	gtk_window_set_title(GTK_WINDOW(window), "Gnurilla");
	g_signal_connect(G_OBJECT(window), "delete-event", G_CALLBACK(gnurilla_cb_delete_event), NULL);
	gd->window = window;
	
	menubar = gnurilla_create_menubar(gd, "src/menubar.xml");
	toolbar = gnurilla_create_toolbar(gd, "src/toolbar.xml");
	notebook = gnurilla_create_notebook(gd);
	statusbar = gtk_statusbar_new();
	
	vbox = gtk_vbox_new(FALSE, 1);
	gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
	gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
	gtk_box_pack_end(GTK_BOX(vbox), statusbar, FALSE, TRUE, 0);
	
	gtk_container_add(GTK_CONTAINER(window), vbox);
	
	gd->notebook = notebook;
	gd->statusbar = statusbar;
	gd->toolbar = toolbar;
	gd->menubar = menubar;
	
	return gd->window;
};
